﻿<Window x:Class="P2.Cuberry.Modules.Framework.ModuleManager.ModuleImportView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper" 
        
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="1107" Height="564"  
        Background="{DynamicResource P2BackgroundBrush}" 
        Closing="Window_Closing"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
        
        <!--<DataTemplate x:Key="SubMenuDataTemplate">
            <Canvas Width="236" Height="48">
                <Image Source="{Binding ItemIconName}" Height="32" Width="32" Canvas.Left="8" Canvas.Top="8"/>
                <TextBlock Text="{Binding MenuItemName}" Canvas.Left="56" Canvas.Top="8" Width="172"/>
            </Canvas>
        </DataTemplate>-->
    </Window.Resources>
    
    
    
    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/save.png" />

            
        </Grid.Resources>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderModulesImport}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="UploadBtn" Margin="2,1,0,2"  Header="{Translate UploadBtn}" 
                          Command="{Binding ModuleUploadCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />                
            </Menu>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>                                
                <TextBlock Margin="14,6,0,0" Height="128" HorizontalAlignment="Left" Name="InformationBlock01" 
                           VerticalAlignment="Top" Width="862" Text="{Translate ImportMessage}" />
                
                <DataGrid Grid.Row="1"  Margin="3,140,3,50" 
                                             Name="ApplicationResourceList" 
                                             ItemsSource="{Binding ApplicationResources}" 
                                              MouseDoubleClick="ApplicationResourceList_MouseDoubleClick"    
                                             Style="{DynamicResource CuberryDataGridStyle}"
                                             VerticalAlignment="Top" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{Translate ItemNameL}" IsReadOnly="True" Width="150" MinWidth="40" />
                        <DataGridTextColumn Header="{Translate ActionTypeL}" IsReadOnly="True" Width="150" MinWidth="40" />
                        <DataGridComboBoxColumn Header="{Translate ActionToBeTakenL}" IsReadOnly="True" Width="150" MinWidth="40" />
                        <DataGridTextColumn Header="{Translate ProcessL}" IsReadOnly="True" Width="*" MinWidth="40" />

                    </DataGrid.Columns>
                    
                </DataGrid>
                <TextBox Height="100" HorizontalAlignment="Left" Margin="6,170,0,0" Name="Descr1" VerticalAlignment="Top" Width="145" TextWrapping="Wrap">This is the name of the 
                    module or the table which will be processed</TextBox>
                <TextBox Height="100" HorizontalAlignment="Left" Margin="152,170,0,0" Name="Descr2" VerticalAlignment="Top" Width="145" TextWrapping="Wrap">This can be "Module DLL Upload" or "Table Creation" or "Table Update"</TextBox>
                <TextBox Height="150" HorizontalAlignment="Left" Margin="300,170,0,0" Name="Descr3" VerticalAlignment="Top" Width="145" TextWrapping="Wrap">This is a combo box which is only active if there is a conflict. In case of a conflict the options are "Keep Current" and "Replace". "Keep Current" is the default value. If no confict then "No Conflict" is shown.</TextBox>
                <TextBox Height="100" HorizontalAlignment="Left" Margin="451,170,0,0" Name="Descr4" VerticalAlignment="Top" Width="258" TextWrapping="Wrap">Here you show the process status. 1.Validated, 2.Processing, 3.Uploaded. You may also show other messages here, e.g. the conflicts messages "Module already exists", "Shared location not available", "Module Corrupt", ...</TextBox>
                <TextBox Height="132" HorizontalAlignment="Left" Margin="715,170,0,0" Name="Descr5" VerticalAlignment="Top" Width="144" TextWrapping="Wrap">All the text will come from the XAppConfig table exept the ItemName</TextBox>
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
